﻿@using GigaSite.Web.Areas.Catalog.Models
@using GigaSite.Web.Classes
@* Партиал вью с элементами для пейджионирования *@
@{
    var page = (int) ViewBag.page;
    var itemsPerPage = (int) ViewBag.itemsPerPage;
    var categoryId = (long) ViewBag.categoryId;
    var filter = (string) ViewBag.filter;
    var textFilter = (string) ViewBag.textFilter;
    var totalCards = (int) ViewBag.cardsCount;
    var totalPagesCount = MathHelper.PagesCount(totalCards, itemsPerPage);
}

<div class="dataHolder" data-page="@page" data-totalitems="@totalCards" data-totalpages="@totalPagesCount" data-itemsperpage="@itemsPerPage"></div>

@* Верхний пагинатор *@
@Html.Partial("PaginatorTop")

@* Сам набор карточек *@
<div class="overview">
    @{
        Html.RenderAction("GetCards",new {filter = filter, page = page, itemsPerPage = itemsPerPage, categoryId = categoryId, textFilter = textFilter});
    }
</div>

@* Нижний пагинатор *@
@Html.Partial("PaginatorBottom",new BottomPaginatorModel()
                                          {
                                              Page = page,
                                              ItemsPerPage = itemsPerPage,
                                              TotalItems = totalCards,
                                              TotalPages = totalPagesCount
                                          })

